home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form frmOptView
- BackColor = &H8000000F&
- BorderStyle = 3 'Fixed Double
- Caption = "Properties"
- ClientHeight = 3195
- ClientLeft = 1230
- ClientTop = 1710
- ClientWidth = 7245
- Height = 3570
- Left = 1185
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 3195
- ScaleWidth = 7245
- Top = 1380
- Width = 7335
- Begin ListBox lstView
- Height = 615
- Left = 120
- TabIndex = 8
- Top = 2280
- Width = 6855
- End
- Begin CheckBox chkView
- Caption = "CRC"
- Height = 375
- Index = 7
- Left = 2400
- TabIndex = 7
- Top = 1680
- Value = 1 'Checked
- Width = 1935
- End
- Begin CommandButton cmdOptView
- Caption = "&Help"
- Height = 495
- Index = 2
- Left = 5160
- TabIndex = 11
- Top = 1440
- Width = 1815
- End
- Begin CommandButton cmdOptView
- Cancel = -1 'True
- Caption = "&Cancel"
- Height = 495
- Index = 1
- Left = 5160
- TabIndex = 10
- Top = 840
- Width = 1815
- End
- Begin CommandButton cmdOptView
- Caption = "&OK"
- Default = -1 'True
- Height = 495
- Index = 0
- Left = 5160
- TabIndex = 9
- Top = 240
- Width = 1815
- End
- Begin CheckBox chkView
- Caption = "Attribute"
- Height = 375
- Index = 5
- Left = 2400
- TabIndex = 5
- Top = 720
- Value = 1 'Checked
- Width = 1935
- End
- Begin CheckBox chkView
- Caption = "Compression Type"
- Height = 375
- Index = 6
- Left = 2400
- TabIndex = 6
- Top = 1200
- Value = 1 'Checked
- Width = 1935
- End
- Begin CheckBox chkView
- Caption = "Time"
- Height = 375
- Index = 4
- Left = 2400
- TabIndex = 4
- Top = 240
- Value = 1 'Checked
- Width = 1935
- End
- Begin CheckBox chkView
- Caption = "Date"
- Height = 375
- Index = 3
- Left = 360
- TabIndex = 3
- Top = 1680
- Value = 1 'Checked
- Width = 1935
- End
- Begin CheckBox chkView
- Caption = "Compression Rate"
- Height = 375
- Index = 2
- Left = 360
- TabIndex = 2
- Top = 1200
- Value = 1 'Checked
- Width = 1935
- End
- Begin CheckBox chkView
- Caption = "Archive File Size"
- Height = 375
- Index = 1
- Left = 360
- TabIndex = 1
- Top = 720
- Value = 1 'Checked
- Width = 1935
- End
- Begin CheckBox chkView
- Caption = "File Size"
- Height = 375
- Index = 0
- Left = 360
- TabIndex = 0
- Top = 240
- Value = 1 'Checked
- Width = 1935
- End
- '===================================================
- 'Sample VB program using UNLHA.DLL
- 'VBDeVew.Frm (frmOptView)
- 'Original: Niiyama(HEROPA) SGV00153@niftyserve.or.jp
- 'English : Hitoshi Ozawa h_ozawa@bekkoame.or.jp
- '===================================================
- Option Explicit
- Const BTN_OK = 0
- Const BTN_CANCEL = 1
- Const BTN_HELP = 2
- Const L_NAME = " README.TXT "
- Const L_ORGINAL = " 1528"
- Const L_PACKED = " 871"
- Const L_RATIO = " 57.0%"
- Const L_DATE = " 95-11-08"
- Const L_TIME = " 07:57:46"
- Const L_ATTRIB = " a--w"
- Const L_TYPE = " -lh5-"
- Const L_CRC = " 90E4"
- Sub chkView_Click (Index As Integer)
- Dim strTmp As String
- strTmp$ = L_NAME
- If chkView(0).Value = CHECKED Then strTmp$ = strTmp$ & L_ORGINAL
- If chkView(1).Value = CHECKED Then strTmp$ = strTmp$ & L_PACKED
- If chkView(2).Value = CHECKED Then strTmp$ = strTmp$ & L_RATIO
- If chkView(3).Value = CHECKED Then strTmp$ = strTmp$ & L_DATE
- If chkView(4).Value = CHECKED Then strTmp$ = strTmp$ & L_TIME
- If chkView(5).Value = CHECKED Then strTmp$ = strTmp$ & L_ATTRIB
- If chkView(6).Value = CHECKED Then strTmp$ = strTmp$ & L_TYPE
- If chkView(7).Value = CHECKED Then strTmp$ = strTmp$ & L_CRC
- strTmp$ = strTmp$ & " "
- lstView.Clear
- lstView.AddItem strTmp$
- End Sub
- Sub cmdOptView_Click (Index As Integer)
- Dim intLoopCount As Integer
- Dim strTmp As String
- Dim intReturnCode As Integer
- Select Case Index
- Case BTN_OK
- For intLoopCount% = 0 To Len(gstrListViewOption$) - 1
- strTmp$ = strTmp$ & CStr(chkView(intLoopCount%).Value)
- Next intLoopCount
- gstrListViewOption$ = strTmp$
- Unload Me
- Case BTN_CANCEL
- Unload Me
- Case BTN_HELP
- intReturnCode% = WinHelp(frmArchive.hWnd, gstrHelpFile$, HELP_CONTEXT, ByVal HLP_DLGVIEWCONFIG&)
- End Select
- End Sub
- Sub Form_Load ()
- Dim intLoopCount As Integer
- Dim strTmp As String
- Dim intListWidth As Integer
- Call SetControlPosition
- Call SetControl3D
- For intLoopCount% = 0 To Len(gstrListViewOption$) - 1
- chkView(intLoopCount%).Value = Val(Mid$(gstrListViewOption$, intLoopCount% + 1, 1))
- Next intLoopCount%
- strTmp$ = L_NAME
- If chkView(0).Value = CHECKED Then strTmp$ = strTmp$ & L_ORGINAL
- If chkView(1).Value = CHECKED Then strTmp$ = strTmp$ & L_PACKED
- If chkView(2).Value = CHECKED Then strTmp$ = strTmp$ & L_RATIO
- If chkView(3).Value = CHECKED Then strTmp$ = strTmp$ & L_DATE
- If chkView(4).Value = CHECKED Then strTmp$ = strTmp$ & L_TIME
- If chkView(5).Value = CHECKED Then strTmp$ = strTmp$ & L_ATTRIB
- If chkView(6).Value = CHECKED Then strTmp$ = strTmp$ & L_TYPE
- If chkView(7).Value = CHECKED Then strTmp$ = strTmp$ & L_CRC
- lstView.Clear
- lstView.AddItem strTmp$
- 'Calculate height and width necessary to display
- Me.FontName = lstView.FontName
- intListWidth% = Me.TextWidth(L_NAME & L_ORGINAL & L_PACKED & L_RATIO & L_DATE & L_TIME & L_ATTRIB & L_TYPE & L_CRC & " ") / Screen.TwipsPerPixelX
- Call SetLstBoxHScrollBar(lstView, intListWidth%)
- Call SetChildWindowPos(frmArchive, Me)
- Call DeleteSwitchTo(Me)
- Me.Icon = frmArchive.Icon
- Me.Caption = APP_CAPTION & " - " & Me.Caption
- Me.HelpContextID = HLP_DLGVIEWCONFIG
- 'If help file does not exist
- If gstrHelpFile$ = "" Then cmdOptView(BTN_HELP).Enabled = False
- End Sub
- Sub lstView_Click ()
- lstView.ListIndex = -1
- End Sub
- Sub SetControl3D ()
- Me.AutoRedraw = True
- Call Draw3DControl(lstView)
- Call Draw3DForm(Me)
- Me.AutoRedraw = False
- End Sub
- Sub SetControlPosition ()
- Dim intLoopCount As Integer
- Const DLG_SPACE = 4
- chkView(0).Left = 2 * DLG_SPACE * Screen.TwipsPerPixelX
- chkView(0).Top = 2 * DLG_SPACE * Screen.TwipsPerPixelY
- chkView(0).Width = Me.TextWidth(chkView(1).Caption) + 8 * DLG_SPACE * Screen.TwipsPerPixelX
- chkView(0).Height = Me.TextHeight("|") + DLG_SPACE * Screen.TwipsPerPixelY
- chkView(0).BackColor = Me.BackColor
- For intLoopCount% = 1 To 3
- chkView(intLoopCount%).Left = chkView(intLoopCount% - 1).Left
- chkView(intLoopCount%).Top = chkView(intLoopCount% - 1).Top + chkView(intLoopCount% - 1).Height + DLG_SPACE * Screen.TwipsPerPixelY
- chkView(intLoopCount%).Width = chkView(intLoopCount% - 1).Width
- chkView(intLoopCount%).Height = chkView(intLoopCount% - 1).Height
- chkView(intLoopCount%).BackColor = Me.BackColor
- Next intLoopCount%
- chkView(4).Left = chkView(0).Left + chkView(0).Width + DLG_SPACE * Screen.TwipsPerPixelX
- chkView(4).Top = chkView(0).Top
- chkView(4).Width = chkView(0).Width
- chkView(4).Height = chkView(0).Height
- chkView(4).BackColor = Me.BackColor
-
- For intLoopCount% = 5 To 7
- chkView(intLoopCount%).Left = chkView(intLoopCount% - 1).Left
- chkView(intLoopCount%).Top = chkView(intLoopCount% - 1).Top + chkView(intLoopCount% - 1).Height + DLG_SPACE * Screen.TwipsPerPixelY
- chkView(intLoopCount%).Width = chkView(intLoopCount% - 1).Width
- chkView(intLoopCount%).Height = chkView(intLoopCount% - 1).Height
- chkView(intLoopCount%).BackColor = Me.BackColor
- Next intLoopCount%
- cmdOptView(0).Left = chkView(4).Left + chkView(4).Width * 1.5
- cmdOptView(0).Top = chkView(4).Top
- cmdOptView(0).Width = Me.TextWidth("
- (H)") + 5 * DLG_SPACE * Screen.TwipsPerPixelX
- cmdOptView(0).Height = Me.TextHeight("OK") + 3 * DLG_SPACE * Screen.TwipsPerPixelY
- For intLoopCount% = 1 To 2
- cmdOptView(intLoopCount%).Left = cmdOptView(intLoopCount% - 1).Left
- cmdOptView(intLoopCount%).Top = cmdOptView(intLoopCount% - 1).Top + cmdOptView(intLoopCount% - 1).Height + DLG_SPACE * Screen.TwipsPerPixelY
- cmdOptView(intLoopCount%).Width = cmdOptView(intLoopCount% - 1).Width
- cmdOptView(intLoopCount%).Height = cmdOptView(intLoopCount% - 1).Height
- Next intLoopCount%
- lstView.Left = chkView(0).Left
- lstView.Top = cmdOptView(2).Top + cmdOptView(2).Height + 2 * DLG_SPACE * Screen.TwipsPerPixelY
- lstView.Width = cmdOptView(0).Left + cmdOptView(0).Width - lstView.Left
- lstView.Height = Me.TextHeight("|") + (3 + gintCYHSCROLL%) * Screen.TwipsPerPixelY
- Me.Width = lstView.Left + lstView.Width + (2 * DLG_SPACE + 2 * gintCXDLGFRAME + 2) * Screen.TwipsPerPixelX
- Me.Height = lstView.Top + lstView.Height + (2 * DLG_SPACE + 2 * gintCYDLGFRAME + gintCYCAPTION + 2) * Screen.TwipsPerPixelY
- End Sub
-